/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SaveData;

import java.util.List;

/**
 *
 * @author ADAM
 */
public final class HTMLTextConverter extends Builder{

    public HTMLTextConverter(List<String> list) {
        mStr = "<html>\n<head>\n<title>\nAnaliza DNA</title></head>\n<body><table border=\"2\">\n<tr>\n<td>\n";
        for (String elem : list) {
            parseString(elem);
            makeNewRow();
        }
        makeNewLine();

    }

    
    @Override
    public void makeNewLine() {
        mStr = mStr.concat("</td>\n</tr>\n<tr>\n<td>");
    }

    @Override
    public void makeNewRow() {
        mStr = mStr.concat("</td>\n<td>");
    }

    @Override
    public void parseString(String pmStr) {
        mStr = mStr.concat(pmStr);
    }
    
    @Override
    public String endText() {
        String ending = "</td>\n</tr></table>\n</body><html>";
        return super.endText()+ending;
    }
    
    
}
